﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmBuscarProducto.aspx.cs" Inherits="Farmacia.net.Almacen.frmBuscarProducto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .style1
    {
        width: 100%;
    }
    .style2
    {
    }
    .style3
    {
        width: 134px;
    }
    .style4
    {
        width: 269px;
    }
    .style5
    {
        width: 107px;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Buscar Productos</h2>
    <fieldset>
    <legend>Buscar</legend>
        <table class="style1">
            <tr>
                <td class="style3">
    <b>Criterio:</b></td>
                <td class="style2" colspan="2">
    <b> 
        <asp:TextBox ID="txtCriterio" runat="server" Width="265px"></asp:TextBox>
        </b>
                </td>
                <td>
    <b>
        <asp:Button ID="btnBuscar" runat="server" Text="Buscar" 
            onclick="btnBuscar_Click" />
        </b>
                </td>
            </tr>
            <tr>
                <td class="style3">
    <b>Proveedor :</b></td>
                <td class="style4">
    <b>
        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="OdsProveedor" 
            DataTextField="RazonSocial" DataValueField="RazonSocial" Height="23px" 
            Width="241px" AppendDataBoundItems="True" AutoPostBack="True">
            <asp:ListItem Selected="True" Value="%">Seleccionar Item</asp:ListItem>
        </asp:DropDownList>
        <asp:ObjectDataSource ID="OdsProveedor" runat="server" 
            onobjectcreating="OdsProveedor_ObjectCreating" 
            SelectMethod="GetAllFromProveedor" 
            TypeName="Farmacia.BussinessLogic.ProveedorBL"></asp:ObjectDataSource>
        </b>
                </td>
                <td class="style5">
                    Laboratorio:</td>
                <td>
                    <asp:DropDownList ID="DropDownList2" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="ODSLaboratorio" DataTextField="Nombre" 
                        DataValueField="Nombre" Width="216px">
                        <asp:ListItem Selected="True" Value="%">Seleccionar Item</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="ODSLaboratorio" runat="server" 
                        onobjectcreating="ODSLaboratorio_ObjectCreating" 
                        SelectMethod="GetAllFromLaboratorio" 
                        TypeName="Farmacia.BussinessLogic.Almacen.Laborat.LaboratorioBL">
                    </asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    Grupo Farmacologico:</td>
                <td class="style4">
                    <asp:DropDownList ID="DropDownList3" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="odsGrupoFarma" DataTextField="Nombre" 
                        DataValueField="Nombre" Height="16px" Width="236px">
                        <asp:ListItem Selected="True" Value="%">Seleccionar</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="odsGrupoFarma" runat="server" 
                        onobjectcreating="odsGrupoFarma_ObjectCreating" 
                        SelectMethod="GetAllGrupoFarmacologico" 
                        TypeName="Farmacia.BussinessLogic.Almacen.GrupoFarma.GrupoFarmaBL">
                    </asp:ObjectDataSource>
                </td>
                <td class="style5">
                    Principio Activo</td>
                <td>
                    <asp:DropDownList ID="DropDownList4" runat="server" AppendDataBoundItems="True" 
                        AutoPostBack="True" DataSourceID="ODSPrincipioActivo" DataTextField="Nombre" 
                        DataValueField="Nombre" Width="210px">
                        <asp:ListItem Selected="True" Value="%">Seleccionar</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="ODSPrincipioActivo" runat="server" 
                        onobjectcreating="ODSPrincipioActivo_ObjectCreating" 
                        SelectMethod="GetAllFromPrincActivo" 
                        TypeName="Farmacia.BussinessLogic.Almacen.PrincActivo.PrincipioActivoBL">
                    </asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    &nbsp;</td>
                <td class="style4">
                    &nbsp;</td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
    <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" 
        AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" 
            ForeColor="#333333" GridLines="None" Width="661px">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="IdProducto" HeaderText="Id" 
                SortExpression="IdProducto" />
            <asp:BoundField DataField="Descripcion" HeaderText="Descripcion" 
                SortExpression="Descripcion" >
            <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="Proveedor" HeaderText="Proveedor" 
                SortExpression="Proveedor" />
            <asp:BoundField DataField="PrecioVentaUnidad" HeaderText="Precio Unidad" 
                SortExpression="PrecioVentaUnidad" />
            <asp:BoundField DataField="PrecioVentaSubUnidad" HeaderText="PrecioSubUnidad" 
                SortExpression="PrecioVentaSubUnidad" />
            <asp:BoundField DataField="Laboratorio" HeaderText="Lab" 
                SortExpression="Laboratorio" />
            <asp:BoundField DataField="GrupoFarmacologico" HeaderText="GrupoFarm" 
                SortExpression="GrupoFarmacologico" />
            <asp:BoundField DataField="PrincActivo" HeaderText="PrincActivo" 
                SortExpression="PrincActivo" />
            <asp:HyperLinkField AccessibleHeaderText="Ver Detalles" 
                DataNavigateUrlFields="idProducto" 
                DataNavigateUrlFormatString="frmProductoStock.aspx?acc=ver&amp;idProducto={0}" 
                FooterText="VerDetallles" HeaderText="Detalles" Text="Ver Detalles" />
        </Columns>
        <EditRowStyle BackColor="#900001" />
        <EmptyDataTemplate>
            &nbsp;
        </EmptyDataTemplate>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="LightBlue" HorizontalAlign="Center" Width = "50px"/>
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Width="80px" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetFromProdbyCriterioAndLaboratorioANDPrincipioActivoANDGrupoFarmacologicoANDPROVEEDOR" 
            TypeName="Farmacia.BussinessLogic.ProductoBL" 
            onobjectcreating="ObjectDataSource1_ObjectCreating" 
            DeleteMethod="DeleteProducto">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="txtCriterio" DefaultValue="%" Name="Criterio" 
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="DropDownList2" DefaultValue="%" 
                Name="Laboratorio" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropDownList4" DefaultValue="%" 
                Name="PrincAct" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropDownList3" DefaultValue="%" 
                Name="GrupFarm" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropDownList1" DefaultValue="%" 
                Name="Proveedor" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </fieldset>
    
    
</p>
</asp:Content>
